package com.wenhai.spring.generic;

import java.util.ArrayList;
import java.util.List;

/**
 * Java 泛型实例
 *
 * @author wenhai
 * @date   2021/4/9
 */
public class GenericTypeDemo {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("1");

        // 编译器不再报错
        List temp = list;
        temp.add(1);
    }
}
